package blog.pojo;

import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * @author HuLin
 * @date
 */
@AllArgsConstructor
@NoArgsConstructor
@Data
public class Blog implements Serializable {
    private Integer id;
    private String title;
    private String content;
    private String image;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    private Date createTime;
    private Integer hit;
    private Integer commentNum;
    private Integer likes;
    private int state;

    @TableField(select = false,exist = false)//当mybatis-plus执行查询的时候这个字段不生效
    private Category category;//关联分类表
    @TableField(select = false, exist = false)
    private User user;

//    关联评论表comments 1:n
    @TableField(select = false,exist = false)
    private List<Comments> commentsList;
}
